package staticcodearea;

public class Demo1 {
    public static void main(String[] args) {
        Zi zi = new Zi();
    }
}

class Fu{
    static{
        System.out.println("父类的静态代码块执行了1");
    }

    {
        System.out.println("父类的构造代码块执行了3");
    }

    public Fu(){
        super();
        System.out.println("父类的无参构造执行了4");
    }

    public Fu(int num){
        this();
        System.out.println("父类的"+num+"参构造执行了5");
    }
}

class Zi extends Fu{
    static{
        System.out.println("子类的静态代码块执行了2");
    }

    {
        System.out.println("子类的构造代码块执行了6");
    }

    public Zi(){
        this("Hello");
        System.out.println("子类的无参构造执行了8");
    }

    public Zi(String str){
        super(100);
        System.out.println("子类的"+str+"参构造执行了7");
    }
}
